home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1919 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: medtechnet.com!dreams!tony.johnston
  2. From: Tony.Johnston@dreams.medtechnet.com (Tony Johnston)
  3. Date: 13 Jan 96 23:09:00 
  4. Newsgroups: comp.lang.c++
  5. Subject: If statements, HELP!!
  6. Message-ID: <956_9601132330@medtechnet.com>
  7. Organization: Med TechNet
  8.  
  9. Can anyone see in this code fragment why this if statement wont do what
  10. I need it to do.  Using Borland C++ 4.0:
  11.  
  12.  
  13. {
  14.  
  15.     if (SysopPercent > UserPercents)  <--If this is true it should fall down 
  16.        {                                 to the next if, if false it should
  17.                                          go to the ELSE
  18.        if (SysTime < LockTime)        <--If true it should process its
  19.                                          statement, if false it should fall
  20.                                          down to the else
  21.        TDDisplayFile("LOCK.ANS");
  22.        }
  23.        else
  24.         TBDoors_Tmp.Open();
  25.         TBDoors_Tmp.Read();
  26.         TBDoors_Tmp.WhereTheDoorWasCalledFrom(5);
  27.         TBDoors_Tmp.Write();
  28.         TBDoors_Tmp.Close();
  29.  
  30.  
  31. }
  32.  
  33. What is happening is that when the first IF is true it is falling to the 
  34. next IF, but both If statements are ignoring the ELSE staement, I need it so 
  35. that if the first IF is false it will go to the else amd if the second IF is 
  36. false it also will go to the ELSE.  I want to be able to use the same else 
  37. for both IF's and cant get it to work, it just keeps bypassing the ELSE 
  38. statement.
  39.  
  40.   Thanks,
  41.    -=[ Tony ]=-
  42.  
  43.